<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/


//后台登录
Route::get('/admin/login', 'Admin\LoginController@login');
Route::post('/admin/doLogin', 'Admin\LoginController@dologin');
Route::get('/admin/logout', 'Admin\LoginController@logout');

//验证码
Route::get('/admin/captcha/{tmp}', 'CodeController@captcha');


// 邮箱验证
Route::get('/admin/forget','Admin\ForgetController@forget');
Route::post('/admin/forget/sendEmail','Admin\ForgetController@sendEmail');
Route::get('/admin/forget/reset/{id}/{remember_token}','Admin\ForgetController@reset');
Route::get('/admin/forget/info','Admin\ForgetController@info');
Route::post('/admin/forget/repass','Admin\ForgetController@repass');

// 后台模块
Route::group(['middleware' => 'login'], function(){
	// 后台用户模块
	Route::get('admin',"Admin\IndexController@index");
	// 用户添加页面
	Route::get('/admin/user/add','Admin\UserController@add');
	// 用户添加
	Route::post('/admin/user/insert','Admin\UserController@insert');
	// 用户列表页面
	Route::get('/admin/user/index','Admin\UserController@index');
	// 用户编辑
	Route::any('/admin/user/update','Admin\UserController@edit');
	// 用户详情更新
	Route::post('/admin/user/update','Admin\UserController@update');
	// 用户删除
	Route::get('/admin/user/delete','Admin\UserController@delete');

	// 后台商品模块
	// 商品添加页面
	Route::get('/admin/goods/add','Admin\GoodsController@add');
	// 商品添加
	Route::post('/admin/goods/insert','Admin\GoodsController@insert');
	// 商品列表页面
	Route::get('/admin/goods/index','Admin\GoodsController@index');
	// 商品编辑页面
	Route::any('/admin/goods/update','Admin\GoodsController@edit');
	// 商品详情更新
	Route::post('/admin/goods/update','Admin\GoodsController@update');
	// 商品的删除
	Route::get('/admin/goods/delete','Admin\GoodsController@delete');
	// 商品版本添加页面
	Route::get('/admin/goods/EditionInsert','Admin\GoodsController@edition');
	// 商品版本添加
	Route::post('/admin/goods/editionAdd','Admin\GoodsController@editionAdd');
	// 商品版本列表页面
	Route::get('/admin/goods/EditionIndex','Admin\GoodsController@EditionIndex');
	// 商品版本原有的基础上在增加的页面
	Route::get('/admin/goods/VersionInsert','Admin\GoodsController@VersionInsert');
	// 商品版本原有的基础上在增加的操作
	Route::any('/admin/goods/VersionAdd','Admin\GoodsController@VersionAdd');
	// 商品版本删除
	Route::get('/admin/goods/VersionDelete','Admin\GoodsController@VersionDelete');
	// 商品分类添加页面
	Route::get('/admin/goods/AddType','Admin\GoodsController@typeAdd');
	// 商品分类添加
	Route::post('/admin/goods/TypeInsert','Admin\GoodsController@TypeInsert');

	
	// 商品分类添加页面
	Route::get('/admin/type/add','Admin\TypeController@add');
	// 商品分类添加
	Route::post('/admin/type/insert','Admin\TypeController@insert');
	// 商品分类列表页面
	Route::get('/admin/type/index','Admin\TypeController@index');
	// 商品分类修改页面
	Route::get('/admin/type/edit','Admin\TypeController@edit');
	// 商品分类修改
	Route::post('/admin/type/update','Admin\TypeController@update');
	// 商品分类删除
	Route::get('/admin/type/delete','Admin\TypeController@delete');
});



// 前台登录
Route::get('/home/login', 'Home\LoginController@login');

// 前台
Route::get('/',"Home\IndexController@index");
// 登录
Route::get('/home/denglu','Home\DengluController@denglu');
// 注册
Route::get('/home/zhuce','Home\ZhuceController@zhuce');

